//
//  WHShowMoreHeader.m
//  YLFinanceService
//
//  Created by she1323 on 2017/12/11.
//  Copyright © 2017年 she1323. All rights reserved.
//

#import "WHShowMoreHeader.h"

@interface WHShowMoreHeader()

@property (weak, nonatomic) IBOutlet UILabel *contentLabel;
@property (weak, nonatomic) IBOutlet UIImageView *icon;
@property (weak, nonatomic) IBOutlet UIView *baseView;



@end

@implementation WHShowMoreHeader


+ (instancetype)header
{
    WHShowMoreHeader *header = [[NSBundle mainBundle] loadNibNamed:@"WHShowMoreHeader" owner:nil options:nil].lastObject;
    return header;
}

- (void)awakeFromNib
{
    [super awakeFromNib];
    self.userInteractionEnabled = YES;
    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] init];
    _baseView.layer.masksToBounds = YES;
    _baseView.layer.borderWidth = 1.0;
    _baseView.layer.borderColor = YLColor(230, 230, 230).CGColor;
    _moreSignal = [tap rac_gestureSignal];
    [self addGestureRecognizer:tap];
}

- (void)setContentTitle:(NSString *)contentTitle
{
    _contentTitle = contentTitle;
    _contentLabel.text = contentTitle;
    [_contentLabel sizeToFit];
    _baseView.layer.cornerRadius = (_contentLabel.frame.size.height + 20) / 2.0;
}

- (void)setShowUp:(BOOL)showUp
{
    _showUp = showUp;
    _icon.image = showUp ? [UIImage imageNamed:@"up"] : [UIImage imageNamed:@"down"];
}




@end
